<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('is_logged_in'))
{
	function is_logged_in(){
		$is_logged_in = $this->session->userdata('is_logged_in');
		if (!isset($is_logged_in) || $is_logged_in != true) {
			echo "You don't have permission";
			die();
		}
	}  
}

if ( ! function_exists('logout'))
{
	function logout(){
		$this->session->sess_destroy();
		redirect('/');
	}
}